package com.jwdf.uda.http.action;
import android.content.Context;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.http.AHttpService;
import com.jwdf.uda.http.ApiService;

import java.util.List;

import retrofit2.Call;
/**
 * Created by fatsfan on 2016/9/19.
 */
public class AnswerEditAction extends AHttpService<PbBean.PbResQuestionEditAnswer> {

    private int id;
    private PbBean.PbSignBaseVoteOptionType vote;
    private List<PbBean.PbBaseReqDescription> mDescriptionList;
    public AnswerEditAction(Context context, int id, PbBean.PbSignBaseVoteOptionType vote, List<PbBean.PbBaseReqDescription> descriptionList) {
        super(context);
        this.id = id;
        this.vote = vote;
        this.mDescriptionList = descriptionList;
    }

    @Override
    protected Call newRetrofitCall(ApiService apiService, PbBean.PbBaseClientInfo.Builder baseBuilder) {
        PbBean.PbReqQuestionEditAnswer.Builder builder = PbBean.PbReqQuestionEditAnswer.newBuilder();
        builder.setBaseClientInfo(baseBuilder);
        builder.setAnswerId(id);
        builder.addAllDescription(mDescriptionList);
        builder.setVoteOption(vote);
        return apiService.quizReplyEdit(builder.build());

    }
}
